-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable loading zipped rom files #535
base: master
Are you sure you want to change the base?
Conversation
The second commit fixes a subtle issue in the master branch, where SameBoy requests to I blindly copied the same pattern with my zip patch, but later realized the issue. I am not sure what the behavior of minzip is in this case (it might overwrite the extra space w/ junk data?)... I didn't bother to even check, and opted to just make the code do the "right thing" instead. |
Few notes:
|
Sounds good, I will work on that. I don't understand your last bullet point, though. (I haven't hset up a GnuWin32 build environment yet, so I'm not familiar with how everything is laid out there.) Are you green-lighting my suggestion to bring the latest minizip into the tree, rather than link against it as an external dependency? |
Having a copy of minizip in the tree would sure simplify things (just make sure to update |
Made some minor changes as you suggested, but I did not refactor the zipped rom loading code into SDL/. While I was working on this I realized a few things:
(Sorry if this was already obvious when you asked me to move it to SDL, I'm new here ;)
I have a feeling it will be really easy to get SameBoy working under MSYS2 or one of the others, in fact I wouldn't be surprised if it compiles cleanly as-is, in which case we just need to update the build faq and nothing else. |
fwiw, my vote is to create a "Common/" module, migrate to MSYS2/MinGW, and keep minizip out of tree. I guess we still have to figure out the licensing thing in order to distribute binaries to Windows users... groan |
Windows has basic native zip support (enum and extract), just use |
Not exactly this exact topic but close enough to put here but. While Zip is a common file, 7-zip seems to be increasingly used due to its higher compression ratio. Wouldn't it be a good idea to include this format with supporting other compressed archives? |
Are there any more problems that exist? |
Solves #399, and I think it's a useful feature I plan to use locally.
This adds a new dependency (minizip), some tests in the makefile, and a little bit of ifdef spaghetti. I added an
ENABLE_MINIZIP
variable to make this feature optional, but I defaulted it to 1.I tried to be careful in editing the makefile, but I haven't tested on Windows or OS X. Minizip is very small (just a single .c/.h pair), so the best solution might be to just copy-paste the entire thing into the project and enable the feature unconditionally, which would get rid of the makefile checks and the ifdef spaghetti.
It does feel like this change belongs outside of
Core/gb.c
, for example inSDL/main.c
whereGB_load_rom
is called. However, code would have to be changed at every call site ofGB_load_rom
, and there are a handful of those. Instead, this just makesGB_load_rom
"do the right thing" transparently, and adds aGB_load_rom_from_bin
in case anybody ever needs to access the old behavior. I am open to refactoring this patch to work some other way, though.